import *as echarts from 'echarts'

let echartsId = [];

export function getMyeachrts(id, option) {
    let myeachrts = echarts.init(document.getElementById(id));

    if (echartsId.indexOf(id) == -1) {
        echartsId.push(myeachrts)
    }
    myeachrts.setOption(option)
    setTimeout(() => {
        window.onresize = function () {
            echartsId.forEach(item => {
                item.resize();
            })
        }
    }, 200);
}


